﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PolimericosABM.services;

namespace PolimericosABM.forms
{
    public partial class frmTestConnection : Form
    {
        private PolimeroService _service = new PolimeroService();
        public frmTestConnection()
        {
            InitializeComponent();
        }

        private void btnTestConnection_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                _service.TestConection();
                Cursor = Cursors.Default;
                MessageBox.Show("Conexion exitosa !", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                Cursor = Cursors.Default;
                MessageBox.Show("Error de conexión:\n" + ex.Message, "Info", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
    }
}
